import request from '@/utils/request'
// 获取权限列表
export const getPermissionList = () => {
  return request({
    url: '/sys/permission',
    method: 'get'
  })
}

// 新增权限点
export const addPermission = data => {
  return request({
    url: '/sys/permission',
    method: 'post',
    data
  })
}

// 获取权限点详情
export const getPermissionDetail = id => {
  return request({
    url: `/sys/permission/${id}`,
    method: 'get'
  })
}

// 修改权限点详情
export const editPermission = data => {
  return request({
    url: `/sys/permission/${data.id}`,
    method: 'put',
    data
  })
}

// 删除权限点
export const delPermission = id => {
  return request({
    url: `/sys/permission/${id}`,
    method: 'delete'
  })
}
